﻿using UnityEngine;
using System.Xml.Serialization;
using System.IO;
using System.Text;
using System;
using System.Collections.Generic;

namespace AutoRoot
{
	[XmlType("Story_list")]
	public class Storylist
	{
		public Storylist()
		{
			Stories = new List<Story>();
		}
		
		[XmlElement("Story")]
		public List<Story> Stories { get; set; }
	}

	[XmlType("Story")]
	public class Story
	{
		public Story()
		{
			Chapters = new List<Chapter>();
		}
		
		[XmlElement("Subject")]
		public string Subject { get; set; }
		
		[XmlElement("Path")]
		public string Path { get; set; }

		[XmlElement("Preface")]
		public string Preface { get; set; }
		
		[XmlArray("Chapters")]
		[XmlArrayItem("Chapter")]
		public List<Chapter> Chapters { get; set; }
	}
	
	[XmlType("Chapter")]
	public class Chapter
	{
		public Chapter()
		{
			Options = new List<Option>();
		}

		[XmlElement("Id")]
		public int Id { get; set; }
		
		[XmlElement("Title")]
		public string Title { get; set; }

		//[XmlElement("Option")]
		//public Option Section { get; set; }

		[XmlArray("Options")]
		[XmlArrayItem("Option")]
		public List<Option> Options { get; set; }
	}

/*	[XmlType("Option")]
	public class Option
	{	
		[XmlElement("A")]
		public string Option_A { get; set; }

		[XmlElement("B")]
		public string Option_B { get; set; }

		[XmlElement("C")]
		public string Option_C { get; set; }

		[XmlElement("D")]
		public string Option_D { get; set; }
	}*/

	[XmlType("Option")]
	public class Option
	{	
		public Option()
		{
			Options = new List<Option>();
		}

		[XmlElement("Id")]
		public string Id { get; set; }
		
		[XmlElement("File_name")]
		public string File_name { get; set; }

		[XmlArray("Options")]
		[XmlArrayItem("Option")]
		public List<Option> Options { get; set; }
	}
}


